<template>
  <div class="examlist_container">
    <div class="title">
      <h2> 法治思维 快乐学法</h2>
    </div>
    <div class="typeSelect">
      <h3>
        {{examInfo.theme}}
      </h3>
    </div>
    <div class="timer">
      <h3>
        本次考试成绩
      </h3>
    </div>

    <div class="examlist">
      <div class="examInfo">
        <ul class="result">
          <li>
            <span>题型</span>
            <span>总分</span>
            <span>得分</span>
          </li>

          <li>
            <span>单选题</span>
            <span>{{examPaper.singleTotalPoint}}</span>
            <span>{{examResultInfo.single_point}}</span>
          </li>

          <li>
            <span>多选题</span>
            <span>{{examPaper.multipleTotalPoint}}</span>
            <span>{{examResultInfo.multiple_point}}</span>
          </li>

          <li>
            <span>判断题</span>
            <span>{{examPaper.checkTotalPoint}}</span>
            <span>{{examResultInfo.check_point}}</span>
          </li>
          <li>
            <span>填空题</span>
            <span>{{examPaper.completionTotalPoint}}</span>
            <span>{{examResultInfo.completion_point}}</span>
          </li>
          <li>
            <span>不定项</span>
            <span>{{examPaper.unsurenessTotalPoint}}</span>
            <span>{{examResultInfo.unsureness_point}}</span>
          </li>
          <li>
            <span>总分</span>
            <span>{{examPaper.totalPoint}}</span>
            <span>{{examResultInfo.check_point+examResultInfo.single_point+examResultInfo.multiple_point+examResultInfo.unsureness_point+examResultInfo.completion_point}}</span>
          </li>
        </ul>

      </div>

    </div>
    <div class="hr" style="height:100px"></div>
    <div class="step">
      <van-button round type="info" @click="retry()">重回答题</van-button>
      <van-button round type="info" @click="toIndex()">返回首页</van-button>
    </div>
  </div>
</template>
<style scoped>
</style>
<script>
import path from '@/network'
export default {
  name: 'App',

  data () {
    return {
      examPaper: JSON.parse(sessionStorage.getItem("examPaper")),
      examInfo: JSON.parse(sessionStorage.getItem('examInfo')),
      examResultInfo: JSON.parse(sessionStorage.getItem('examResultInfo')),

      examId: this.$route.query.id,
      checkPoint: '',
      completionPoint: '',
      mulitplePoint: '',
      singlePoint: '',
      totalPoint: '',
      unsurenessPoint: ''
    };
  },

  created () {
  },
  beforeDestroy () {
  },

  mounted () {

  },

  methods: {
    //初始化数据
    queryRecord () {
      path.queryRecord({
        examId: this.$route.query.id
      }).then(res => {
        if (res.success === 0) {
          this.checkPoint = res.rows.checkPoint
          this.completionPoint = res.rows.completionPoint
          this.mulitplePoint = res.rows.mulitplePoint
          this.singlePoint = res.rows.singlePoint
          this.unsurenessPoint = res.rows.unsurenessPoint
          this.totalPoint = res.rows.totalPoint
        }
      })
    },


    // toplist: function () {
    //   this.$router.push({ name: 'toplist', query: { id: this.$route.query.id, } })
    // },

    // recordlist: function () {
    //   this.$router.push({ name: 'recordlist', query: { id: this.$route.query.id, } })
    // },

    toIndex: function () {
      this.$router.push({ name: 'index' })
    },

    retry: function () {
      this.$router.push({ name: 'examList' })
    },


  },
};


</script>